﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="View.aspx.cs" Inherits="JKF.Web.Sys.Log.View" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
        <%= RegScript("~/js/jquery.1.5.js")%>
        <%= RegScript("~/js/jquery.nhis.js")%>
        <%= RegScript("~/js/jquery.rchis.js")%>
        <%= RegScript("~/js/jquery-ui-custom.min.js")%>
        <%= RegScript("~/js/css.js")%>
        <%= RegScript("~/js/DatePicker/WdatePicker.js")%>
        <%= RegScript("~/js/Common.js")%>
        <%= RegScript("~/js/Jquery.commonGrid.js")%>
        <script src="../../js/Uppop/tipswindown2.js"  type="text/javascript"></script>

        <link href="../../App_Themes/Theme2/Include.css"   rel="stylesheet" type="text/css" />
          <script type="text/javascript">
              var isView = '<%=IsView%>'; //是否有浏览权限

              var AppPath = '<%=AppPath %>';
              var handler = AppPath + '/do/Sys/SysLog.do';
              var PageSize = 20;
              var pager = null;
              $(function () {

                  pager = $('#divPager').pager(AppPath, handler, function () {

                      return { ActionName: 'LogSearch', searchItem: $('#dropSearchItem').val(), matchWay: $('#dropMatchWay').val(), keyword: $('#txt_keyword').val(), DATA_START: $('#txt_CREATE_START').val(), DATA_END: $('#txt_CREATE_END').val(),MODULE_NAME: $('#txt_MODULE_NAME').val() };
                  }, function (data) {
                      var tbody = $('#tb tbody');
                      tbody.empty();
                      if (data && data.Entity && data.Entity.length) {
                          data = data.Entity
                          var tr, td;
                          for (var i = 0; i < data.length; i++) {
                              var item = data[i];
                              tr = $("<tr key=" + item.MODULE_KEY + "></tr>").appendTo(tbody);
                              $('<td></td>').appendTo(tr).text(item.MODULE_NAME);
                              $('<td></td>').appendTo(tr).text(item.TABLE_NAME);
                              $('<td></td>').appendTo(tr).text(item.PRIMARY_KEY);
                              $('<td></td>').appendTo(tr).text(item.ACCOUNT);
                              $('<td></td>').appendTo(tr).text(item.LOG_CONTENT);
                              $('<td></td>').appendTo(tr).text(item.DATE_CREATE);
                              $('<td></td>').appendTo(tr).text(item.OPERATION_TYPE);
                              $('<td></td>').appendTo(tr).text(item.IP);
                          }
                      } else {
                          tbody.html('<tr><td id="emptyTr" colspan="9" style="text-align: center">没有数据!</td></tr>');

                      }
                      var tbHeight = $(window).height() - $(".common_search").height() - $("#divPager").height() - 36;
                      tbHeight = tbHeight < 300 ? 300 : tbHeight
                      $("#tb").H8_Grid($("#divPager"), tbHeight);
                  }, PageSize, true);


                  $("#txt_MODULE_NAME").Suggest({ url: AppPath + "/do/Sys/SysModule.do", data: { ActionName: "SuggestModule" }, onSelect: function (data, selectedIndex, selectedItem) {
                      var dr = data.Data.Tables[0].Rows[selectedIndex];
                      $("#txt_MODULE_NAME").val(dr.module_name);
                  }, mutiPage: true, minChars: 0, cache: true
                  });

                  $('#btn_search').click(function () {
                      pager.option.pageIndex = 1;
                      pager.getPegerData();
                      return false;
                  });

              });    
 
      </script>
</head>
<body>
      <div class="warrper_body">  
         <div class="index" style=" overflow:hidden">
            <div class="common_search">
                 <div class="l_h45">  
                    查询项：
                     <select id="dropSearchItem">
                           <option selected value="ACCOUNT">操作员</option>
                           <option value="TABLE_NAME">表名</option>
                           <option value="PRIMARY_KEY">主键值</option>
                           <option value="LOG_CONTENT">操作内容</option>
                           <option value="OPERATION_TYPE">操作类型</option>
                           <option value="IP">访问ip</option>
                     </select>
                     <select id="dropMatchWay" style=" width:35px">
                         <option selected value="=">=</option>
                         <option value="包含">包含</option>
                     </select>
                     <input type="text" id="txt_keyword" value="" />
                    模块名称：<input type="text" id="txt_MODULE_NAME" />
                    操作日期：<input id="txt_CREATE_START" style="width: 100px" type="text" onfocus="WdatePicker()" />
                    至<input id="txt_CREATE_END" style="width: 100px" type="text" onfocus="WdatePicker()" />
                    <span class="mr30"><input name="" id="btn_search" type="button"  class="common_btn_search"/></span>
 
                 </div>
            </div>
            <div class="l_h7"></div>
           
            <div class="index_table">
                <table id="tb" class="common_table">
                    <thead>
                        <tr>
                            <th width="150px" ordertype="string">模块名称</th>
                            <th width="150px" ordertype="string">表名</th>
                            <th width="300px" ordertype="string">主键值</th>
                            <th width="100px" ordertype="string">操作人</th>
                            <th width="300px" ordertype="string">操作内容</th>
                            <th width="150px" ordertype="string">操作时间</th>
                            <th width="100px" ordertype="string">操作类型</th>
                            <th width="100px" ordertype="string">操作者ip</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="8" style="text-align: center">点击搜索查看数据</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="page" id="divPager"></div>      
        </div>
     </div> 
</body>
</html>
